package vn.demand.dragon.model.business
{
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.http.HTTPService;
	
	public class SaveTaskLogDelegate
	{
		
		private var service : HTTPService;
		
		
		public function SaveTaskLogDelegate(result:Function, fault:Function)
		{
			service = new HTTPService();
			service.url = "http://dev.dragon.com/index.php?m=timecard&a=tasklog_save&suppressHeaders=1";
//			service.url = "data/qitems_save.xml";
			service.method = 'POST';
			service.resultFormat = 'e4x';
			service.addEventListener(ResultEvent.RESULT, result);
			service.addEventListener(FaultEvent.FAULT, fault);
		}
		
		public function saveTaskLog(xml:String):void {			
			service.send({'xml': xml});
		}

	}
}